package user

import (
	middleware "gin_blog/apps/middleware"
	"github.com/gin-gonic/gin"
)

func Router(router *gin.RouterGroup) {
	//登陆之后查看个人信息
	router.GET("/:user_id", middleware.RequestInfos(), middleware.RequestAuth(), userGet)
	//获取用户列表 admin
	router.GET("", middleware.RequestInfos(), middleware.RequestAuth(), usersGet)
	//登录 不用验证 web
	router.POST("/login", middleware.RequestInfos(), userPostLogin)
	//登出 web
	router.POST("/logout", middleware.RequestInfos(), middleware.RequestAuth(), userPostLogout)
	//注册 不用验证 web
	router.POST("/register", middleware.RequestInfos(), userPostRegister)
	//修改用户信息 web
	router.PUT("/:user_id", middleware.RequestInfos(), middleware.RequestAuth(), userPut)
	//删除用户信息 web
	router.DELETE("/:user_id", middleware.RequestInfos(), middleware.RequestAuth(), userDelete)
}
